import { Entity, Column, OneToMany, PrimaryColumn } from "typeorm";
import { BblHomeContent } from "./home.content.entity";

@Entity("BBL_HOME_SECTION")
export class BblHomeSection {
  @PrimaryColumn({
    name: "HOME_SECTION_ID",
    type: "varchar",
    length: 50,
    comment: "段落ID"
  })
  sectionId: string;

  @Column({
    name: "HOME_SECTION_TOPIC_VISIBLE",
    type: "int",
    nullable: false,
    comment: "段落主题是否可见, 0:不可见，1:可见"
  })
  isSectionTopicVisible: number;

  @Column({
    name: "HOME_SECTION_MAIN_TOPIC",
    type: "varchar",
    length: 255,
    nullable: true,
    comment: "段落主标题"
  })
  sectionMainTopic: string;

  @Column({
    name: "HOME_SECTION_SUB_TOPIC",
    type: "varchar",
    length: 255,
    nullable: true,
    comment: "段落副标题"
  })
  sectionSubTopic: string;

  @Column({
    name: "HOME_SECTION_INDEX",
    type: "int",
    nullable: false,
    comment: "段落顺序"
  })
  sectionIndex: number;

  @OneToMany((type) => BblHomeContent, (content) => content.section)
  sectionContents: BblHomeContent[];
}
